package com.estar.integaration.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.estar.integaration.entity.Material;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author YJL
 * @since 2021-11-18
 */
public interface IMaterialService extends IService<Material> {
    /**
     * 通过materialId获取一个material
     * @param id
     * @return
     */
    Material getOneMaterialById(String id);

    /**
     * 更新material
     * @param material
     */
    void updateMaterial(Material material, UpdateWrapper updateWrapper);

    /**
     * 插入material
     * @param material
     */
    void insertMaterial(Material material);

    public List<Material> getMaterialByPurchased(Integer purchased);

    public void updateMaterial(Integer purchased, Integer unPurchased, String id);

    //更新此material的须购
    public void updateMaterialUnPurchased(String id, Integer unPurchase, Integer BOMQuantity);

    public Material getPByMaNoandENo(String MaterialNo, String aCode);

    //将需购置为0,用库存
    public void updateUnPurchasedToZero(String id);

    //取消用库存
    public void updateCancelUseInventory(String id);

    public List<Material> selectList(QueryWrapper queryWrapper);
    //根据MaterialNo和Time找到material
    public Material selectMaterialByNoTime(String materialNo,String delivery);

    public List<Material> selectListByproductId(String productId);

    public List<Material> selectListByProductACode(String aCode);

    public List<Material> selectChildACodeMaterialListByproductId(String productId);

    public Material selectPurById(String id);

    public void deleteAllByProductId(String productId);

    public List<Material> findAllMaterialInProductandCart();

    public List<Material> selectListByDateOneMonth();

}
